package prototype;

// 实现原型接口的具体类
public class ConcretePrototype implements Prototype {
    private int value;

    public ConcretePrototype(int value) {
        this.value = value;
    }

    // 构造函数用于克隆
    public ConcretePrototype(ConcretePrototype prototype) {
        this.value = prototype.value;
    }

    @Override
    public Prototype clone() {
        return new ConcretePrototype(this);
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }
}
